package com.coldchain.admin.config.api;

import com.coldchain.admin.config.entity.SystemConfig;
import com.coldchain.admin.config.service.ISystemService;
import com.coldchain.common.msg.ObjectRestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author fangliai
 * @since 2018-09-12
 */
@RestController
@RequestMapping("/system/config")
public class SystemController {

    @Autowired
    private ISystemService systemService;

    /**
     * 获取所有的系统配制
     * @return
     */
    @RequestMapping("/info/all")
    public ObjectRestResponse<SystemConfig> infoAll(){
        return new ObjectRestResponse<>().data(systemService.getOne(null));
    }

    /**
     * 获取app系统配制
     * @return
     */
    @RequestMapping("/info")
    public  Object getAppSystemConfig(){
        return new ObjectRestResponse<>().data(systemService.getAppConfig());
    }
}
